package com.itheima.dto;

import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <h1>更新通知Dto</h1>
 *
 * @author <a href="515857087@qq.com">叶世铭</a>
 * @since 2022/12/5
 */
@Data
@ApiModel(value = "更新通知Dto")
public class UpdateNoticeDto implements Serializable {

    /**
     * 通知id
     */
    @NotNull(message = "请选择通知")
    @ApiModelProperty(value = "通知id",required = true)
    private Integer id;

    /**
     *标题
     */
    @NotBlank(message = "标题不能为空")
    @Length(message = "标题最少字数{min},标题最多字数{max}",min = 1,max = 255)
    @ApiModelProperty(value = "标题",required = true)
    private String title;

    /**
     * 通知内容
     */
    @NotBlank(message = "通知内容不能为空")
    @Length(message = "内容最少字数{min},内容最多字数{max}",min = 1,max = 255)
    @ApiModelProperty(value = "通知内容",required = true)
    private String content;

    /**
     *通知内容开始时间
     */
    @ApiModelProperty(value = "通知内容开始时间",required = true)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "通知内容开始时间不能为空")
    private LocalDateTime startTime;

    /**
     *通知内容结束时间
     */
    @ApiModelProperty(value = "通知内容结束时间",required = true)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "通知内容结束时间不能为空")
    private LocalDateTime endTime;

    /**
     *接收者用户id
     */
    @ApiModelProperty(value = "接收者用户id",notes = "广播的时候，不用传人数，默认对当前用户职权以下的所有用户发送通知")
    private List<String> acceptIds;

    /**
     *·
     */
    @ApiModelProperty(value = "发送通知的对象,广播为【ALL】,群发为【MORE】,默认是ALL",notes = "广播是对当前用户以下职权的所有人发通知")
    private String operation= "ALL";
}
